<template>
  <div
    :class="prefixCls"
    style="background-color: #0568C1"
    class="relative h-[100%] lt-md:px-10px lt-sm:px-10px lt-xl:px-10px lt-xl:px-10px"
  >
    <div class="relative mx-auto h-full flex" style="justify-content: center;align-items: center">
      <div class="relative flex-1 p-30px dark:bg-[var(--login-bg-color)] lt-sm:p-10px">
        <!-- 右上角的主题、语言选择 -->
        <!--        <div-->
        <!--          class="flex items-center justify-between text-white at-2xl:justify-end at-xl:justify-end"-->
        <!--        >-->
        <!--          <div class="flex items-center at-2xl:hidden at-xl:hidden">-->
        <!--            <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />-->
        <!--            <span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>-->
        <!--          </div>-->
        <!--          <div class="flex items-center justify-end space-x-10px">-->
        <!--            <ThemeSwitch />-->
        <!--            <LocaleDropdown class="dark:text-white lt-xl:text-white" />-->
        <!--          </div>-->
        <!--        </div>-->
        <!-- 右边的登录界面 -->
        <Transition appear enter-active-class="animate__animated animate__bounceInRight">
          <div
            style="display: flex;flex-direction: column"
            class="m-auto w-[100%] flex items-center at-2xl:max-w-1000px at-lg:max-w-500px at-md:max-w-500px at-xl:max-w-500px"
          >

            <!-- 账号登录 -->
            <div style="background-color: #fff;border-radius: 10px;display: flex;flex-direction: column;">
              <!--              <div class="relative flex items-center text-white" style="margin: 0 auto;">-->
              <!--                <img alt="" class="mr-10px h-48px w-48px" style="width: 180px;height: 50px;padding-top: 40px" src="@/assets/imgs/logo.png" />-->
              <!--              </div>-->
              <div style="display: flex;">
                <div style="width: 400px;display: flex;flex-direction: column;align-items: center;justify-content: center;background-color: aliceblue;border-radius: 10px">
                  <img alt="" class="mr-10px h-48px w-48px" style="width: 100px;height: 100px;" src="@/assets/imgs/logo.png" />
                  <div style="margin-top: 30px;font-size: 24px;font-weight: 600;color: #5B8EC0">欢迎使用本系统</div>
                  <!--                  <img src="@/assets/imgs/login-left.png" style="width: 300px;height: 240px" />-->
                </div>
                <div style="width: 400px;padding:100px 40px;">
                  <LoginForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
                </div>
              </div>
            </div>
            <!-- 手机登录 -->
            <MobileForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
            <!-- 二维码登录 -->
            <QrCodeForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
            <!-- 注册 -->
            <RegisterForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
            <!-- 三方登录 -->
            <SSOLoginVue class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
          </div>
        </Transition>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { underlineToHump } from '@/utils'

import { useDesign } from '@/hooks/web/useDesign'
import { useAppStore } from '@/store/modules/app'
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
import { LocaleDropdown } from '@/layout/components/LocaleDropdown'

import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue } from './components'

defineOptions({ name: 'Login' })

const { t } = useI18n()
const appStore = useAppStore()
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('login')
</script>

<style lang="scss" scoped>
$prefix-cls: #{$namespace}-login;

.#{$prefix-cls} {
  overflow: auto;

  &__left {
    &::before {
      position: absolute;
      top: 0;
      left: 0;
      z-index: -1;
      width: 100%;
      height: 100%;
      background-image: url('@/assets/svgs/login-bg.svg');
      background-position: center;
      background-repeat: no-repeat;
      content: '';
    }
  }
}
</style>
